FILE(GLOB CPPFILES *.cpp)
  


LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/netgen.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/mshmet.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/tetgen.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/buildlayer.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/mmg3d.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/mmg3d-v4.0.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/ff-Ipopt.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/aniso.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/ilut.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/iohdf5.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/PARDISO.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/Curvature.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/scotch.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/SuperLu.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/freeyams.cpp)
LIST(REMOVE_ITEM CPPFILES ${CMAKE_CURRENT_SOURCE_DIR}/UMFPACK64.cpp)


FOREACH(CPPFILE ${CPPFILES})
  GET_FILENAME_COMPONENT(FILENAME ${CPPFILE} NAME_WE)
  ADD_LIBRARY(${FILENAME} MODULE ${CPPFILE})
  TARGET_LINK_LIBRARIES(${FILENAME} ${MPI_CXX_LIBRARIES})
  INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH} 
                      ${CMAKE_SOURCE_DIR}/src/bamglib
                      ${CMAKE_SOURCE_DIR}/src/Graphics
                      ${CMAKE_SOURCE_DIR}/src/femlib
                      ${CMAKE_SOURCE_DIR}/src/fflib)
  SET_TARGET_PROPERTIES(${FILENAME} PROPERTIES PREFIX "")
ENDFOREACH(CPPFILE)

